home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Power 1997 November
/
MACPOWER-1997-11.ISO.7z
/
MACPOWER-1997-11.ISO
/
AMUG
/
MUSIC
/
bol-processor-271-data.sit
/
bol-processor-271-data
/
BP2 examples
/
BP2 data
/
-gr.tryrepeat
< prev
next >
Wrap
Text File
|
1996-06-25
|
664b
|
21 lines
// Bol Processor version BP2.6.1
// Grammar file saved as '-gr.tryrepeat'. Date: Mar 25 Juin 1996 -- 19:20
-se.tryrepeat
-ho.abc
// This grammar creates a string a...b...c... with equal number of occurrences of a,b,c. The number is set by K1
// Two important points:
// (1) use 'ORD' so that erase rules are not seen first
// (2) use weights <1-1> so that the 'repeat' rules are seen once only.
// You would get similar results with 'RND' if erase rules are in the next subgrammar
// You can avoid weights by using '_failed(x,y)' procedures
ORD
S --> X Y Z
<1-1> X --> a X _repeat(K1=3)
<1-1> Y --> b Y _repeat(K1)
<1-1> Z --> c Z _repeat(K1)
X -->
Y -->
Z -->